import { request, propsNotEmpty } from './utils';

export default function uploadUserInfo(options, uploadInfo, token) {
  propsNotEmpty(options, ['API_BASE_URL', 'APP_KEY']);
  
  let {
    APP_KEY,
    API_BASE_URL,
    HEADERS_CONFIG: headersConfig,
  } = options;
  let { rawData, redirect, ...rest } = uploadInfo;
  let params = {
    token,
    appKey: APP_KEY,
    rawData,
    redirect,
    ...rest
  };
  console.log('==开始上传用户信息==  参数为：', params);
  return request(`${API_BASE_URL}wechatMiniApp/mpDecryptedNew2`, params, 'GET', headersConfig);
}